<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>讨论区</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <load href= "__JS__/jshelper.js" />
		<link rel="stylesheet" href="__JS__/kindeditor/themes/default/default.css" />
		<link rel="stylesheet" href="__JS__/kindeditor/plugins/code/prettify.css" />
		<script charset="utf-8" src="__JS__/kindeditor/kindeditor.js"></script>
		<script charset="utf-8" src="__JS__/kindeditor/lang/zh_CN.js"></script>
		<script charset="utf-8" src="__JS__/kindeditor/plugins/code/prettify.js"></script> 
		<script>
		KindEditor.ready(function(K) {
			var editor1 = K.create('textarea[name="text"]', {
				cssPath : '__JS__/kindeditor/plugins/code/prettify.css',
				uploadJson : '__JS__/kindeditor/php/upload_json.php?no={$no}',
				fileManagerJson : '__JS__/kindeditor/php/file_manager_json.php?no={$no}',
				allowFileManager : true,
				afterCreate : function() {
					var self = this;
					K.ctrl(document, 13, function() {
						self.sync();
						K('form[name=response]')[0].submit();
					});
					K.ctrl(self.edit.doc, 13, function() {
						self.sync();
						K('form[name=response]')[0].submit();
					});
				}
			});
			prettyPrint();
		});
	</script>
	<script>
	function discussdelete(id,courseid){
			if (confirm("你确定要删除吗")==true) 
				postwith('__URL__/discussdelete',{id:id,courseid:courseid});
			}
	</script>
  </head>
  <body>
	<layout name="Auth:header" />
    <div class="container-fluid">
      <div class="row-fluid">
        <layout name="Auth:Courseleftmenu" /><!--侧边导航栏-->
        <div class="span8">
          <div class="hero-unit">
          	<h1>{$coursename}讨论区</h1>
            <p style="font-size:12px">当前位置：
		<a href='__APP__/index/index'>主页</a>>
		<a href='__URL__/index' >课程展示</a>>
		<a href='__URL__/course/id/{$courseid}' >{$coursename}</a>>
		<a href="" >讨论区</a></p>
          </div>
           <load href"__PUBLIC__/js/list_show.js">
           <!--帖子名展示-->
          		 <table class="table table-bordered table-striped">
                    <thead>
                      <tr>
                        <th style="display:none">ID</th> 
                        <th width="7%">点击</th>
                        <th width="7%">回复</th>
                        <th class="span5">标题</th>
                        <th class="span1">作者</th>
                        <th class="span2">发表时间</th>
                        <th class="span1">操作</th>
                      </tr>
                    </thead>
                    <tbody>
                    	<volist name='list' id='vo' >
                          <tr>
                            <td style="display:none">
                             	{$vo.id}
                            </td>
                            <td>
                            	{$vo.pv}<!--点击量-->
                            </td>
                            <td>
                            	{$vo.count}<!--回复量-->
                            </td>
                            <td>
                               <a href="__URL__/discusstopic/id/{$vo.id}">{$vo.name}</a><!--标题-->
                            </td>
                            <td>
                               {$vo.nname}<!--作者-->
                            </td>
                            <td>
                            	{$vo.time}<!--发表时间-->
                            </td>
                            <if condition='$a eq 0'>	<!--操作-->
                            <else/>
                            <td>
                                <a href="#"  name="delete_discuss" onClick="discussdelete({$vo.id},{$vo.courseid})" class="btn btn-danger">删除</a>
                            </td>
                            </if>
                          </tr>
                         </volist>
                    </tbody>
  				</table>
          <!--/帖子名展示-->
          <p class="navbar-text pull-right">{$page}</p>
          	<hr>
          <!--textarea输入框-->
          		<div class="span9">
                	<if condition="$role eq '访客'"><p style=" font-size:16px; color:red;"> 访客不能发帖！<a href="__APP__/Auth/logon">登陆</a></p>
                      <else/>
                        <form id='form1' name="discuss" method="post" action="__URL__/discussadd" >
							<div id='result' style="color:red; font-size:12px;"></div>
	                        <input type='hidden' name='courseid' value={$courseid}>
	                       	 标题
	                        <input type="text" name="name" class="input-xxlarge">
	                        <br>
                            内容
	                        <textarea name="text" class="input-xxlarge" style="height:200px;"></textarea>
	                        <br>
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	                         <input name="submit" type="submit" value="发表" class="btn btn-primary" style="width:80px;">

                        </form>
                    </if>
                </div>
          <!--/textarea输入框-->
         <hr>
      <footer>
        <p>&copy;上海应用技术学院 2012</p>
      </footer>
		</div><!--/row-->
    </div><!--/.fluid-container-->
	</div>
  </body>
</html>
